package mysql

import "gorm.io/gorm"

type Class struct {
	gorm.Model
	ClassName string `gorm:"type:varchar(30)"`
}

func (c *Class) FindClassByName(db *gorm.DB, name string) error {
	return db.Debug().Where("name=?", name).First(&c).Error
}

func (c *Class) ClassAdd(db *gorm.DB) error {
	return db.Debug().Create(&c).Error
}
